int GCD(int a,int b){
    int tmp;
    while(a % b){
       tmp = a % b;  
        a = b;
        b = tmp; 
    }
    return b;
}